[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
linerel() Draw Line a Relative Dist From Current Position
#include <graphics.h>
void far linerel(x1,y1);
int x1;
int y1;
linerel() draws a line from the current position (CP) to a point that
is a relative distance ('x1','y1') from the current position. The
line is drawn 'x1' pixels in the x direction and 'y1' pixels in the y
directions. The line is drawn in the current color, line style and
thickness. The (CP) is moved to the new position.
Returns: Nothing.
-------------------------------- Example ---------------------------------
The following statements draw rays out to points relative to the
original current position.
#include <graphics.h>
#include <conio.h>
int gdriver = DETECT;
int gmode;
main()
{
int x0, y0;
initgraph(&gdriver,&gmode,"");
x0 = getx();
y0 = gety();
linerel(100,200);
moveto(x0,y0);
linerel(200,200);
moveto(x0,y0);
linerel(300,200);
moveto(x0,y0);
linerel(400,200);
getch();
closegraph();
}
See Also:
getcolor()
getlinesettings()
line()
lineto()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson